<?php $this->load->view('header/standard'); ?>
<div id="main">
    <div class="container">
        <div class="span-17 colborder" id="content">
            <?php if (isset($messages)) echo $messages; ?>

            <div id="submenu-container" class="span-17 last">
                <?php $this->load->view('menu/profile'); ?>
            </div>

            <?php echo form_open('profile/glider/delete/'.$person->id); ?>
            
	            <?php if (count($pilot->Gliders) == 0): ?>
	                <div class="span-15 last">
	                    <p class="last"><?=lang('home.No_gliders_assigned')?></p>
	                   <span class="span-3 last"><?php echo anchor('profile/glider/add/'.$person->id, lang('profile.glider.Add'))?></span>
	                </div>
	            <?php else: ?>
	                <?php foreach ($pilot->Gliders as $g): ?>
	                <div class="box span-9">
	                    <h4><?php echo GliderModel::getGliderBrand($g->brand) ?> - <?php echo $g->model?></h4>
	                    <dl>
	                    <dt class="caps prepend-top"><?=lang('profile.glider.EN_Certification')?>: </dt>
	                    <dd><?php echo $g->cert_en; ?></dd>
	                    <dt class="caps prepend-top"><?=lang('profile.glider.LTF_Certification')?>: </dt>
	                    <dd><?php echo $g->cert_ltf; ?></dd>
	                    <dt class="caps prepend-top"><?=lang('profile.glider.Is_Prototype')?>: </dt>
	                    <dd><?php echo ($g->proto? lang('profile.glider.Yes') : lang('profile.glider.No')); ?></dd>
	                    </dl>
	                </div>
	                <div class="box span-7 last">
	                    <h4>
	                        <span><?php echo form_checkbox('gid_'.$g->id, 'gid_'.$g->id)?></span>
	                        <?=lang('profile.glider.Details')?>
	                    </h4>
	                    <dl>
	                    <dt class="caps prepend-top"><?=lang('profile.glider.Serial_Number')?>: </dt>
	                    <dd><?php echo $g->PilotGliderModel[0]->serial; ?></dd>
	                    <dt class="caps prepend-top"><?=lang('profile.glider.Built')?>: </dt>
	                    <dd><?php echo $g->PilotGliderModel[0]->built; ?></dd>
	                    <dt class="caps prepend-top"><?=lang('profile.glider.Last_Test')?>: </dt>
	                    <dd><?php echo $g->PilotGliderModel[0]->tested; ?></dd>
	                    <dt>&nbsp;</dt>
	                    <dd>
	                            [ <?php echo anchor('profile/glider/edit/'.$person->id.'/'.$g->id, lang('profile.glider.Edit'))?> | 
	                              <?php echo anchor('profile/glider/delete/'.$person->id.'/'.$g->id, lang('profile.glider.Delete'))?> ]
                        </dd>
	                    </dl>
	                </div>
	                <?php endforeach; ?>
	                <div class="span-17 last form-actions-panel">
	                   <?php echo anchor('profile/glider/add/'.$person->id, lang('profile.glider.Add'))?> |
	                   <?php echo form_submit('action', lang('profile.glider.Delete')); ?>
	                </div>
	            <?php endif; ?>
            
            <?php echo form_close(); ?>
        </div> <!-- end content -->
        <div class="span-6 last" id="sidebar">
          <?php $this->load->view('menu/sidebar', array('person' => $person, 'context' => 'profile/glider'))?>
        </div> <!-- end sidebar -->
    </div> <!-- end container -->
</div> <!-- end main -->
<?php $this->load->view('footer/standard');?>
